package com.gitee.mars.tourserver.controller;

import com.gitee.mars.tourserver.request.HotelOrderRequest;
import com.gitee.mars.tourserver.response.result.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.AllArgsConstructor;

import java.util.Arrays;

import com.gitee.mars.tourserver.entity.HotelOrder;
import com.gitee.mars.tourserver.service.IHotelOrderService;

/**
 * HotelOrder 控制层
 *
 * @Author wq
 * @Date 2021-05-10
 **/
@RestController
@RequestMapping("/hotelOrder")
@AllArgsConstructor
public class HotelOrderController {

    private final IHotelOrderService hotelOrderService;


    @PostMapping("/createOrder")
    public R createOrder(@RequestBody HotelOrderRequest request) {
        hotelOrderService.createOrder(request);
        return R.success();
    }

    @PostMapping("/list")
    public R list(@RequestBody HotelOrderRequest request) {
        return R.success(hotelOrderService.list(request));
    }


}